package com.song.mapper;

import com.song.pojo.Clazz;
import com.song.pojo.ClazzQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClazzMapper {

    List<Clazz> getClazzs(ClazzQueryParam param);
    @Delete("delete from clazz where id=#{id}")
    Integer deleteClazzById(Integer id);

    @Insert("insert into clazz(name,room,begin_date,end_date,master_id,subject,create_time,update_time) values(#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{createTime},#{updateTime})")
    Integer addClazz(Clazz clazz);

    @Select("select * from clazz where id=#{id}")
    Clazz getClazzById(Integer id);

    @Update("update clazz set name=#{name},room=#{room},begin_date=#{beginDate},end_date=#{endDate},master_id=#{masterId},subject=#{subject},update_time=#{updateTime} where id=#{id}")
    Integer updateClazzById(Clazz clazz);
    @Select("select * from clazz")
    List<Clazz> getAllClazz();
}
